
function selectProductBack(rows) {
	var html = "";
	for ( var i = 0; i < rows.length; i++) {
		html = '<tr>'
		+'<td  style="display:none"><input type="hidden" name="orderMeasureList[#index#].engineerId.id" value="'+rows[i].id+'"/></td>'
		+'<td ><input style="width: 20px;" type="checkbox" name="ck" /></td>'
		+'<td > <input  name="orderMeasureList[#index#].engineerName" value="'+rows[i].userName+'" readonly="readonly"/></td>'
		+'<td ><input name="orderMeasureList[#index#].engineerTel" value="'+rows[i].mobilePhone+'" readonly="readonly"/></td>'
		
		$("#add_orderMeasure_table").append(html);
		resetTrNum('add_orderMeasure_table');
	}
	
}



function delBtnClick() {
	
	$("#add_orderMeasure_table").find("input:checked").parent().parent().remove();
	resetTrNum('add_orderMeasure_table');
}
$(document).ready(function() {
	$(".datagrid-toolbar").parent().css("width", "auto");
	// 将表格的表头固定
		$("#product_table").createhftable( {
			height : '400px',
			width : 'auto',
			fixFooter : false
		});
	});

// 初始化下标
function resetTrNum(tableId) {
	$tbody = $("#" + tableId + "");
	$tbody.find('>tr').each(function(i) {
		$(':input, select', this).each(function() {
			var $this = $(this), name = $this.attr('name'), val = $this.val();
			if (name != null) {
				if (name.indexOf("#index#") >= 0) {
					$this.attr("name", name.replace('#index#', i));
				} else {
					var s = name.indexOf("[");
					var e = name.indexOf("]");
					var new_name = name.substring(s + 1, e);
					$this.attr("name", name.replace(new_name, i));
				}
			}
		});
	});
}
